doctype html
html(lang=node.document.$attr("lang", "en") )
  head
    meta(charset="UTF-8")
    - revealjsdir = node.$attr('revealjsdir', 'reveal.js')
    each key in ["description","keywords","author","copyright"]
      if node.$attr(key, false)
        meta(name=key,content=node.$attr(key))
    title= node.$doctitle()
    meta(content="yes",name="apple-mobile-web-app-capable")
    meta(content="black-translucent",name="apple-mobile-web-app-status-bar-style")
    meta(content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui",name="viewport")
    link(href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css",rel="stylesheet")
    link(href="#{revealjsdir}/css/reveal.css",rel="stylesheet")
    if node.$attr("revealjs_customtheme", false)
      link(rel='stylesheet',href="#{node.$attr('revealjs_customtheme')}",id='theme')
    else
      link(rel='stylesheet',href='#{revealjsdir}/css/theme/serif.css',id='theme')
    link(href="#{revealjsdir}/lib/css/zenburn.css",rel="stylesheet")
    script(src = "http://getfirebug.com/firebug-lite.js#startOpened=false")
    script(type='text/javascript').
      document.write('<link rel="stylesheet" href="#{revealjsdir}/css/print/' + ( window.location.search.match(/print-pdf/gi) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">');
  body
    .reveal
      .slides !{node.$content()}
    script(src = "#{revealjsdir}/lib/js/head.min.js")
    script(src = "#{revealjsdir}/js/reveal.js")
    script(type='text/javascript').
      function initializeReveal() {
        // See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options
        Reveal.initialize({
          // Display controls in the bottom right corner
          controls: #{node.$attr('revealjs_controls', true)},
          // Display a presentation progress bar
          progress: #{node.$attr('revealjs_progress', true) },
          // Display the page number of the current slide
          slideNumber: #{node.$attr('revealjs_slidenumber', true) },
          // Push each slide change to the browser history
          history: #{node.$attr('revealjs_history', true) },
          // Enable keyboard shortcuts for navigation
          keyboard: #{node.$attr('revealjs_keyboard', true) },
          // Enable the slide overview mode
          overview: #{node.$attr('revealjs_overview', true) },
          // Vertical centering of slides
          center: #{node.$attr('revealjs_center', true) },
          // Enables touch navigation on devices with touch input
          touch: #{node.$attr('revealjs_touch', true) },
          // Loop the presentation
          loop: #{node.$attr('revealjs_loop', false) },
          // Change the presentation direction to be RTL
          rtl: #{node.$attr('revealjs_rtl', false) },
          // Turns fragments on and off globally
          fragments: #{node.$attr('revealjs_fragments', true) },
          // Flags if the presentation is running in an embedded mode,
          // i.e. contained within a limited portion of the screen
          embedded: #{node.$attr('revealjs_embedded', false) },
          // Number of milliseconds between automatically proceeding to the
          // next slide, disabled when set to 0, this value can be overwritten
          // by using a data-autoslide attribute on your slides
          autoSlide: #{node.$attr('revealjs_autoslide', 0) },
          // Stop auto-sliding after user input
          autoSlideStoppable: #{node.$attr('revealjs_autoslidestoppable', true) },
          // Enable slide navigation via mouse wheel
          mouseWheel: #{node.$attr('revealjs_mousewheel', true) },
          // Hides the address bar on mobile devices
          hideAddressBar: #{node.$attr('revealjs_hideaddressbar', true) },
          // Opens links in an iframe preview overlay
          previewLinks: #{node.$attr('revealjs_previewlinks', false) },
          // Theme (e.g., beige, blond, default, moon, night, serif, simple, sky, solarized)
          theme: Reveal.getQueryHash().theme || '#{node.$attr('revealjs_theme', 'serif') }',
          // Transition style (e.g., default, cube, page, concave, zoom, linear, fade, none)
          transition: Reveal.getQueryHash().transition || '#{node.$attr('revealjs_transition', 'default') }',
          // Transition speed (e.g., default, fast, slow)
          transitionSpeed: '#{node.$attr('revealjs_transitionspeed', 'default') }',
          // Transition style for full page slide backgrounds (e.g., default, none, slide, concave, convex, zoom)
          backgroundTransition: '#{node.$attr('revealjs_backgroundtransition', 'default') }',
          // Number of slides away from the current that are visible
          viewDistance: #{node.$attr('revealjs_viewdistance', 3)},
          // Parallax background image (e.g., "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'")
          parallaxBackgroundImage: '#{node.$attr('revealjs_parallaxbackgroundimage', '') }',
          // Parallax background size in CSS syntax (e.g., "2100px 900px")
          parallaxBackgroundSize: '#{node.$attr('revealjs_parallaxbackgroundsize', '') }',
          // Optional libraries used to extend on reveal.js
          dependencies: [
            {
              src: '#{revealjsdir}/lib/js/classList.js',
              condition: function () { return !document.body.classList; }
            },
            #{(node.$attr('source-highlighter') == 'highlight.js') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : ""}
            {
              src: '#{revealjsdir}/plugin/zoom-js/zoom.js',
              async: true,
              condition: function () { return !!document.body.classList; }
            },
            {
              src: '#{revealjsdir}/plugin/notes/notes.js',
              async: true,
              condition: function () { return !!document.body.classList; }
            }
          ]
        });
      }
      initializeReveal();
